/*
 * Socket/File utility common routines.
 */

#ifndef _SOCK_H_
#define _SOCK_H_

//Open server socket
int open_server_socket(char *ip, int port, int max_q_len);

//Read from socket/file line by line.
int read_line(int fd, char* buffer, size_t max_size);

//Read from socket/file chunk by chunk
int read_buffer(int fd, char* buffer, size_t max_size);

//Write to socket/file.
int write_buffer(int fd, const char* buffer, size_t size);

#endif // _SOCK_H_
